package com.dhcc.core.modules.system.service;

import org.springframework.web.multipart.MultipartFile;

import com.dhcc.core.framework.base.service.IBaseService;
import com.dhcc.core.modules.system.entity.PanAttachment;

import java.util.List;


/**
 * 表数据服务层接口
 * 
 * @ClassName: IPanAttachmentService
 * @Description: TODO
 * @author mk
 * @date 2018-08-31 10:07:21
 */
public interface IPanAttachmentService extends IBaseService<PanAttachment> {
    /**
     * 删除文件
     * 先减引用数，当引用数为0，物理删除文件
     * @param attachmentId
     */
    void deleteAttachmentById(Long attachmentId);
    /**
     * 保存文件
     * @param file
     * @return
     */
    PanAttachment saveFile(MultipartFile file);

    /**
     * 判断用户拥有那些文件
     * @param userId
     * @param attachmentId
     * @return
     */
    List<PanAttachment> hasAttachmentByUserId(Long userId, List<Long> attachmentId);

    /**
     * 批量更新引用数
     * @param quote 正负代表引用数加减
     * @param attachmentId
     */
    void updataQuoteByListId(int quote,List<Long> attachmentId);
}
